<?php
/**
 * 抽奖模型
 *
 */
namespace Admin\Model;
use Think\Model;
class BaseModel extends Model{

	protected $errCode = 0;
    protected $errMsg = 'ok';

    public function setErrMsg($errCode, $errMsg)
    {
        $this->errCode = $errCode;
        $this->errMsg  = $errMsg;
    }

    public function getErrMsg()
    {
        return array('errcode'=>$this->errCode, 'errmsg'=>$this->errMsg);
    }
	
    public function operatelog($userId, $userName, $operation,$type,$id)
    {
        $maps['uid'] = $userId;
        $maps['name'] = $userName;
        $maps['add_time'] = time();
        //操作对象 分类管理
        $maps['operation'] = $operation;
        //1添加2删除3更改
        $maps['type'] = $type;
        //操作的记录id
        $maps['operation_id'] = $id;

        $data = M('log')->add($maps);
    }
}
?>